<#import "spring.ftl" as spring />
<#import "/inspector-time-macros.ftl" as imacro />

<html>
<head>
	<title>my.inspectortime.com</title>
</head>
<body>

<div id="content">


	<h1>FIND AN INSPECTOR:</h1>
	
	<@imacro.listErrors "command" />
	
	<p>Please enter a name in the field below. It can be an Inspector Company or a Real Estate Company name, 
		or even the name of an Inspector or Realtor.</p>
		
	<p>We'll pull up any Inspector Companies relevant to your search criteria.</p> 
	
	<form method="post" name="searchForm">
		<table class="formTable">
			<tr>
				<th>Search Term</th>
				<td><@spring.formInput "command.searchTerm", 'size="25"'/></td>
			</tr>
		</table>
		
		<p><input type="submit" class="formButton" value="SEARCH" /></p>

	</form>
	
	<#if results??>
		<h2>SEARCH RESULTS</h2>
	
		<table class="standard">
			<tr>
				<th>NAME</th>	
				<th>STATE</th>
				<th>CITY</th>
				<th>STREET</th>
				<th>ZIP</th>
				<th></th>
			</tr>
			<#if results?has_content>
				<#list results as company>
					<tr>
						<td class="rowHeader"><a href="<@spring.url "/inspectors/${company.shortName}/schedule1.html?fromSearch=true" />">${company.name?upper_case}</a></td>
						<td>${(company.address.state?upper_case)!}</td>
						<td>${(company.address.city?upper_case)!}</td>
						<td>${(company.address.street1?upper_case)!}</td>
						<td>${company.address.zipCode?upper_case}</td>
						<td><a target="_new" href="http://www.mapquest.com/maps/map.adp?address=${company.address.street1!}&city=${company.address.city!}&zipcode=${company.address.zipCode}&country=US">MAP</a></td>
					</tr>
				</#list>
			<#else>
				<tr>
					<td colspan="6">NO RESULTS FOUND. PLEASE REFINE YOUR SEARCH</td>
				</tr>
			</#if>
		</table>
	</#if>
</div>

</body>
</html>
